package com.hik.controller;

import com.alibaba.fastjson.JSONObject;
import com.hik.entity.HySelect;
import com.hik.entity.MeetingEntity;
import com.hik.utils.HikHcUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;

@Api(tags = "会议管理")
@RestController
@RequestMapping("hygl")
public class HikHYGLController {
    @ApiOperation("添加会议")
    @PutMapping("add")
    public JSONObject createHY(@ApiParam("会议实体类")@RequestBody MeetingEntity meetingEntity){
        String str=JSONObject.toJSONString(meetingEntity);
        JSONObject jsonObject= HikHcUtils.hyAdd(str);
        return jsonObject;
    }
    @ApiOperation("分页会议")
    @PutMapping("hySelect")
    public JSONObject createHY(@ApiParam("会议分页查询")@RequestBody HySelect h){
        String str=JSONObject.toJSONString(h);
        JSONObject jsonObject= HikHcUtils.hySelect(str);
        return jsonObject;
    }
    @ApiOperation("会议详情")
    @GetMapping("hyxq")
    public JSONObject hyxq(@ApiParam("会议详情")@RequestParam("indexCode")String indexCode){
        JSONObject jsonObject =HikHcUtils.hyXQ(indexCode);
        return jsonObject;
    }
    @ApiOperation("会议删除")
    @GetMapping("hydelete")
    public JSONObject hyDelete(@ApiParam("会议详情")@RequestParam("indexCode")String indexCode){
        JSONObject jsonObject =HikHcUtils.hyDeletel(indexCode);
        return jsonObject;
    }
}
